package pers.vic.xqd.protocol.http;

import org.apache.catalina.*;
import org.apache.catalina.connector.Connector;
import org.apache.catalina.core.StandardContext;
import org.apache.catalina.core.StandardEngine;
import org.apache.catalina.core.StandardHost;
import org.apache.catalina.startup.Tomcat;
import pers.vic.xqd.framerwork.Invocation;
import pers.vic.xqd.framerwork.Protocol;
import pers.vic.xqd.framerwork.Url;

/**
 * 描述:
 * @author Vic.xu
 * @date 2022-02-07 17:35
 */
public class HttpProtocol implements Protocol {


    @Override
    public void start(Url url) {
        new HttpServer().start(url.getHostname(), url.getPort());
    }

    @Override
    public String send(Url url, Invocation invocation) {
        return new HttpClient().send(url.getHostname(), url.getPort(), invocation);
    }
}
